<?php

class App_View_Helper_ImageThumbnail
{
    function imageThumbnail($sourcePath, $destPath, $w, $h, $q = 80) {
		if (!file_exists($destPath)) {
		    	$thumb = new PhpThumb_GdThumb ( $sourcePath );
				$thumb->resize ( $w, $h );
				$thumb->setOptions ( array ('jpegQuality' => $q ) );
				$thumb->save ( $destPath, 'JPG' );
		}
	}      
	
}